package com.yue.design.singleton;

public class Test {
    public static void main(String[] args) {
        new Test().testLzay1();
    }
    public void testHungry(){
        for(int i=0;i<100;i++){
            new Thread(()->{
                System.out.println(Thread.currentThread().getName()+'_'+Hungry.getInstance().hashCode());},"thread-name-"+i).start();
        }
    }
    public void testLzay1(){
        for(int i=0;i<100;i++){
            new Thread(()->{
                System.out.println(Thread.currentThread().getName()+'_'+LazySingleTon.getInstance().hashCode());},"thread-name-"+i).start();
        }
    }
}
